import biosbob.targets.ti.arm.CortexM3_C;

metaonly module BuildC inherits amaret.freestyle.core.distro.IBaseC {

    readonly config ti.targets.ITarget.Module TI_Target;
}

implementation {

    TOOLSDIR := "C:/Program Files/Texas Instruments/TMS470 Code Generation Tools 4.5.2";
    
    final Target := CortexM3_C;
    
    Target.platform := 'amaret.platforms.ek_lm3s811';
    Target.rootDir := TOOLSDIR;
    
    Target.profiles['whole_program'].filters := [{moduleName: 'biosbob.filters.blas.FilterTI'}];
    Target.profiles['whole_program_debug'].filters := [{moduleName: 'biosbob.filters.blas.FilterTI'}];
    
    final TI_Target := CortexM3_C;
    
    TI_Target.ccOpts.prefix += " -I " + ^^java.lang.System.getenv('STELLARISWARE')^^;
    TI_Target.ccOpts.prefix += " -I " + ^^java.lang.System.getenv('STELLARISWARE')^^ + "/boards/ek-lm3s811";

    TI_Target.ccConfigOpts.prefix += " --single_inline --inline_recursion_limit=20";
    TI_Target.ccConfigOpts.suffix += " --symdebug:none";
    
    Build.platformTable[Target.platform] := { toolsDir: TOOLSDIR };

}
